package org.example.likou150.array;

/*
* https://leetcode.cn/problems/remove-element/?envType=study-plan-v2&envId=top-interview-150
* */
public class RemoveElement {
    public static void main(String[] args) {

    }

    public int removeElement(int[] nums, int val) {
        int count=0;
        for(int i=0; i<nums.length; i++){
            if(val!=nums[i]){
                nums[count++]=nums[i];
            }
        }
        return count;
    }
}
